package com.thunder.rebot.rebotclient.utils;

import android.util.Log;
import android.view.View;
import android.widget.ImageView;

//import com.github.chrisbanes.photoview.PhotoView;
import com.thunder.rebot.rebotclient.control.MapImageView;
import com.thunder.rebot.rebotclient.entity.MapCenterEntity;
import com.thunder.rebot.rebotclient.view.MyPhontoView;

public class CommonUtils {

    private static String TAG = CommonUtils.class.getSimpleName();

    /*
  图标的出世位置
   */
    public static MapCenterEntity getMapCenter(final MapImageView map) {
        MapCenterEntity mce = new MapCenterEntity();
        int w = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
        int h = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
        map.measure(w, h);
        int height = map.getMeasuredHeight();
        int width = map.getMeasuredWidth();
        Log.d(TAG, "@@map :" + height + "," + width);
        mce.setxPix(width);
        mce.setyPix(height);
        return mce;
    }
    /*
图标的出世位置
 */
    public static MapCenterEntity getMapCenter1(final MyPhontoView map) {
        MapCenterEntity mce = new MapCenterEntity();
        int w = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
        int h = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
        map.measure(w, h);
        int height = map.getMeasuredHeight();
        int width = map.getMeasuredWidth();
        Log.d(TAG, "@@map :" + height + "," + width);
        mce.setxPix(width);
        mce.setyPix(height);
        return mce;
    }
}
